package jmc.util;

import java.sql.Timestamp;

import com.ibm.as400.access.AS400;


import jmc.core.service.impl.PdiManagerImpl;

public class ThreadPd0022PGM extends Thread{

	private AS400 as400 = null;
	private String reportNumber = "";
	private String clientNumber = "";
	private String proceso = "";
	private String dateDesde = "";
	private String dateHasta = "";

	
	/**
	 * @param args
	 */
	public ThreadPd0022PGM(AS400 as400, String reportNumber, String clientNumber, String proceso, String dateDesde, String dateHasta ){
		this.as400 = as400;
		this.reportNumber = reportNumber;
		this.clientNumber = clientNumber;
		this.proceso = proceso;
		this.dateDesde = dateDesde;
		this.dateHasta = dateHasta;
	}

	public void run(){
		PdiManagerImpl pdiManagerImpl = new PdiManagerImpl();
		System.out.println("Empece el PD0022 " + new Timestamp(System.currentTimeMillis()));
		pdiManagerImpl.callPRGPD0022(as400, reportNumber, clientNumber, proceso, dateDesde, dateHasta);
		if (this.as400 != null){
			as400.disconnectAllServices();
		}
		System.out.println("Termine el PD0022 " + new Timestamp(System.currentTimeMillis()));
	} 

	

}
